package cn.test;

/**
 * @ClassName PersonnalIofo
 * @Description TODO
 * @Author 郑万富
 * @Date 2020/11/9 10:19
 * @Version 1.0
 */

import java.util.Scanner;

/**
 * 编写一个程序，打印输出你的个人信息，并根据你输入的身份证号码，自动获取输出打印你的出身年月日、年龄、性别；
* */
public class PersonalInfo {
    private String id;//学生身份证号
    private String birthday;//学生出生年月
    private int age;//学生年龄
    private String sex;//学生性别

    public PersonalInfo() {
    }

    public PersonalInfo(String id, String birthday, int age, String sex) {
        this.id = id;
        this.birthday = birthday;
        this.age = age;
        this.sex = sex;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "PersonalInfo{" +
                "birthday='" + birthday + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                '}';
    }
    public void judge(){

        System.out.println("please input you id:");
        Scanner inputId = new Scanner(System.in);
        String id = inputId.nextLine();
        if(id.equals(this.getId())){
            System.out.println(this.toString());
        }else {
            System.out.println("your id is error");
        }
    }
}
